package com.wildfire.controller;


import com.wildfire.web.Result;
import com.wildfire.service.UserService;
import com.wildfire.vo.UserQueryReq;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;


/**
 * Controller模板
 *
 * @author zwxu5
 */
@Api(tags = "用户功能")
@RestController
@Slf4j
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/getUserPage")
    public ResponseEntity<Result> getUserPage(@RequestBody UserQueryReq userQueryReq) {
        return ResponseEntity.ok(Result.success(userService.getUserPage(userQueryReq)));
    }

    @GetMapping("/getUserInfo")
    public ResponseEntity<Result> getUserInfo(String token) {
        return ResponseEntity.ok(Result.success(userService.getUserInfo(token)));
    }


}
